<?php
/**
 * Created by PhpStorm.
 * User: MrHung
 * Date: 7/2/14
 * Time: 3:34 PM
 */
session_start();
error_reporting(0);
if (   isset ( $_POST['title'] )) {
        $_POST['title'] = trim( ucfirst( $_POST['title'] ) );
        $_POST['sort'] = trim( strtolower( $_POST['sort'] ) );

        //<---  * REQUIRE * ----->
        require_once('../../class_ajax_request/classAjaxAdmin.php');
        include_once('../../application/functions.php');
        include_once('../../application/DataConfig.php');

       //echo json_encode($_POST);die;
        $objs = new AjaxRequestAdmin();
        //UPDATE BD
        $res = $objs->addCategory();
       if($res == true){
           $response = array(
               'success'=>true,
               'message'=>'Create category success!'
           );
       }else{
           $response = array(
               'success'=>false,
               'message'=>'Error, create fail!'
           );
       }
    echo  json_encode($response);  die;

}// END IF SESSION ACTIVE